home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / VIDEO3.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  1.3 KB  |  43 lines

  1. /*  viedo3.c - char output calls for Video_IO */
  2. /* note that vid_wca() and vid_gca() do not advance cursor */
  3.  
  4. #include   "stdio.h"
  5. #include   "cminor.h"
  6. #include   "asmtools.h"
  7. #include   "keyio.h"
  8. #include   "video.h"
  9.  
  10. int  vid_wca(c,a)                       /* display char and attribute */
  11.   int   c  ;                            /* char to display */
  12.   int   a  ;                            /* attribute */
  13.   {
  14.      REGS  sreg , dreg ;
  15.  
  16.      sreg.bx = a & 0xff ;
  17.      sreg.ax = c & 0xff ;
  18.      sreg.cx = 1 ;                      /* count of chars to display = 1 */
  19.      vidint(V_WCA,&sreg,&dreg) ;
  20.   }
  21.  
  22. int  vid_gca(pc,pa)                     /* get char and attribute at cursor */
  23.   char  *pc   ;                         /* store character here */
  24.   char  *pa   ;                         /* store attribute here */
  25.   {
  26.      REGS  sreg , dreg ;
  27.  
  28.      sreg.bx = 0 ;
  29.      vidint(V_CGA,&sreg,&dreg)    ;
  30.      *pc = ( (BYTE_REGS *) &dreg) -> al ;
  31.      *pa = ( (BYTE_REGS *) &dreg) -> ah ;
  32.   }
  33.  
  34. int  vid_tc(c)                          /* output one char with TTY write */
  35.   int   c  ;                            /* char to write */
  36.   {
  37.      REGS  sreg , dreg ;
  38.  
  39.      sreg.bx = 0 ;
  40.      sreg.ax = c & 0xff ;
  41.      vidint(V_WTTY,&sreg,&dreg) ;       /* write char & advance cur. */
  42.   }
  43.